package com.ztesoft.report.dao;

import com.ztesoft.report.base.dao.BaseMapper;
import com.ztesoft.report.entity.Report;
import com.ztesoft.report.entity.ReportCategory;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 报表类别表 Mapper 接口
 * </p>
 *
 * @author y3tu
 * @since 2018-05-29
 */
@Component
public interface ReportCategoryDao extends BaseMapper<ReportCategory> {

    List<ReportCategory> getNodeByParentId(int parentId);

    int countNodeByParentId(int parentId);

    void addTreeNode(ReportCategory reportCategory);

    void updateHasChildById(ReportCategory reportCategory);

    void delTreeNode(ReportCategory reportCategory);

    void updateTreeNode(ReportCategory reportCategory);

    List<Report> getReportList(Map param);

    void delReport(Map<String, Object> map);

    int countSameParentSameNameNode(ReportCategory reportCategory);

    List<ReportCategory> getAll();

    /**
     * 通过userid 或者roleid获取报表
     * @param param
     * @return
     */
    List<Report> getReportByUserId(Map param);
}